javascript array sorting

the sort() method sorts an array alphabetically

the reverse() method reverses the elements in an array

numeric sort the array in ascending order

the compare function

here we are doing a demo , click the button to sort te array.

sorting an array in random order

click the button again and again to change the array in random order

highest and lowest array value

the lowest number is